home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 351-375 / disk_360 / uucp / uucp0.lzh / src / lib / lsys.c < prev    next >
C/C++ Source or Header  |  1990-04-04  |  857b  |  46 lines

  1.  
  2. /*
  3.  *  LSYS.C
  4.  *
  5.  *  $Header: Beta:src/uucp/src/lib/RCS/lsys.c,v 1.1 90/02/02 12:08:20 dillon Exp Locker: dillon $
  6.  *
  7.  *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  8.  *
  9.  */
  10.  
  11. #include <exec/types.h>
  12. #include <stdio.h>
  13. #include "config.h"
  14.  
  15. Prototype int is_in_L_sys_file(const char *);
  16.  
  17. int
  18. is_in_L_sys_file(system_name)
  19. const char *system_name;
  20. {
  21.     static char buf[256];
  22.     static char system[128];
  23.     FILE *fd;
  24.     char *lsysFile = MakeConfigPath(UULIB, "L.sys");
  25.  
  26.     if (!(fd = fopen(lsysFile, "r"))) {
  27.     printf("Couldn't open %s\n", lsysFile);
  28.     exit(1);
  29.     }
  30.  
  31.     sprintf(system, "%s ", system_name);
  32.  
  33.     while (fgets(buf, sizeof buf, fd)) {
  34.     if (buf[0] == '#' || buf[0] == '\n')
  35.         continue;
  36.     if (strncmp(buf, system, strlen(system)) == 0) {
  37.         fclose(fd);
  38.         return TRUE;
  39.     }
  40.     }
  41.     fclose(fd);
  42.     return FALSE;
  43. }
  44.  
  45.  
  46.